//
//  YIem_Find_Topics_DetailViewController.m
//  B段_开眼
//
//  Created by YIem on 16/4/28.
//  Copyright © 2016年 Howie. All rights reserved.
//

#import "YIem_Find_Topics_DetailViewController.h"
#import <WebKit/WebKit.h>
@interface YIem_Find_Topics_DetailViewController ()
@property (nonatomic, strong) WKWebView *webView;
@end

@implementation YIem_Find_Topics_DetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationItem.title = @"开眼专题";
    
    // 返回
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"btn_back_normal"] style:UIBarButtonItemStylePlain target:self action:@selector(leftAction)];
    self.navigationItem.leftBarButtonItem.tintColor = [UIColor colorWithRed:0.2077 green:0.2077 blue:0.2077 alpha:1.0];
    
    
    
    NSArray *arr = [self.strUrl componentsSeparatedByString:@"&url="];
   
    
    NSString *str = [[arr objectAtIndex:1] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
 

//    NSLog(@"%@", str);
    
    self.webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 64, self.view.frame.size.width, self.view.frame.size.height) ];
    
    dispatch_async(dispatch_get_main_queue(), ^{
        
    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:str]]];
    });

    
    [self.view addSubview:self.webView];

    
    
    
    
    
}


- (void)leftAction
{
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
